<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog x-modal-dialog" style="width: 650px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire" title="编辑数据"></i>&nbsp;&nbsp;<span>编辑数据&nbsp;-&nbsp;健身数据</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>
    
    <form id="fit-edit-form" class="form-horizontal" method="POST" action="${ctx.host}/users/${userId}/fit" data-validate="true">

      <input type="hidden" name="_method" value="PATCH" />
      
      <input type="hidden" name="userId" value="${userId}" />
      

      <div class="modal-body">

        <div class="form-horizontal bottom-margin-20">
                
          <div class="form-group x-form-group">
            <label class="control-label col-xs-4">身高：</label> 
            <div class="col-xs-6 pull-left">
              <input type="text" name="height" class="form-control" value="${user.userFit.height }" data-validate="required">
            </div>
          </div>
          
          <div class="form-group x-form-group">
            <label class="control-label col-xs-4">体重：</label>
            <div class="col-xs-6 pull-left">
              <input type="text" name="weight" class="form-control" value="${user.userFit.weight }" data-validate="required">
            </div>
          </div>
            
          <div class="form-group x-form-group">
            <label class="control-label col-xs-4">性别：</label>
            <div class="col-xs-6 pull-left">
              <select name="gender"  class="form-control select2" data-validate="required">
                <c:forEach var="gender" items="${enums['gender']}">
                  <c:if test="${gender.display}">
                    <option value="${gender}" ${user.userFit.gender eq gender ? 'selected' : ''}>${gender.description}</option>
                </c:if>
                </c:forEach>
              </select>
            </div>
          </div>
          
          <div class="form-group x-form-group">
            <label class="control-label col-xs-4">年龄：</label>
            <div class="col-xs-6 pull-left">
              <input type="text" name="age" class="form-control date" value="${user.userFit.age}">
            </div>
          </div>
          
        </div>
        
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
        
    </form>
    
  </div>
</div>
